<!-- 观察菜单 -->
<template>
  <div class="">
    <n-dropdown trigger="hover" @select="handleSelect" :options="options">
      <span class="sz">更多<i class="iconfont dx-xiala"></i></span>
    </n-dropdown>
  </div>
</template>
<script lang='ts' setup>
import { ref } from "vue";
import { dxget, dxpost, hf } from "../../util/index";
import {gpType} from "../../util/config"
const emit = defineEmits(["CallBack"]);
// 1.重点观察   11 振幅观察  9 到买盘大于60观察  4 已买观察  5 资讯观察  6 财经快讯观察  7 淘金观察  8 公告观察  3 新股观察 10 短线助手  11概念龙头
const props = defineProps({
  obj: {
    type: Array,
    default: [],
  },
  rowData: {
    type: Object,
    default: [],
  },
});

let options = ref([
  ...gpType,
  {
    label: "龙虎榜",
    key: "111",
  },
  {
    label: "删除",
    key: "101",
  },
]);

const handleSelect = async (key) => {
  if (key == "111") {
    hf("winnersList", { code: props.rowData.secCode });
    return;
  }
  if (key == "101") {
    window.$useDialog.warning({
      title: "警告",
      content: "确定要删除吗？",
      positiveText: "确定",
      negativeText: "取消",
      onPositiveClick: async () => {
        await dxpost("gupiao/delectGp", { id: props.rowData.id });
        window.$message.success("删除成功");
        emit("CallBack");
      },
    });

    return;
  }
  await dxget("gupiao/setstoploss", {
    id: props.rowData.id,
    observetype: key,
  });
  emit("CallBack");
};
</script>
<style scoped>
</style>
